# coding: utf-8

from functools import partial

from flask import jsonify


def rest_result(code, message, data=None, pagination=None, error_data_url=None):
    return jsonify({
        'flag': code,
        'message': message,
        'data': data or {},
        'pagination': pagination,
        'error_data_url': error_data_url
    })


rest_success = partial(rest_result, "S")
rest_error = partial(rest_result, "E")
